package com.lantu.sys.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lantu.common.vo.Result;
import com.lantu.sys.entity.Scholarship;
import com.lantu.sys.entity.Students;
import com.lantu.sys.entity.User;
import com.lantu.sys.mapper.StudentsMapper;
import com.lantu.sys.service.IStudentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author mabc
 * @since 2024-06-29
 */


//一定要使用RestController
//    而不是使用Controller
@RestController
//@RequestMapping("/sys/students")
@RequestMapping("/sys")
public class StudentsController {
    //装配serves对象
    @Autowired
    private IStudentsService studentsService;
//    @Autowired
//    private StudentsMapper studentsMapper;

    @GetMapping("/all")
    public Result<List<Students>> getAllStudents() {
        List<Students> list = studentsService.list();
        return Result.fail(20001,"查询成功");

    }

    @PostMapping("/login")
    public Result<Map<String,Object>> login() {

        return Result.success();

    }

//    @GetMapping("/user")
//    //切记要给表单写入参数required = false，不然的话要求该字段必须要有内容否则就会报错
//    public Result<List<Students>> getUserInfo() {
//
//
//    }
}
